﻿
@{
    ViewBag.Title = "手术详细信息";
    Layout = "~/Views/Shared/_Form.cshtml";
}

<form id="form1">
    <div style="padding-top: 20px; margin-right: 30px;">
        <table class="form">
            <tr>
                <th class="formTitle">手术代码：</th>
                <td class="formValue">
                    <input id="ssdm" name="ssdm" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">手术名称：</th>
                <td class="formValue">
                    <input id="ssmc" name="ssmc" type="text" onchange="getZjm()" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">助记码：</th>
                <td class="formValue">
                    <input id="zjm" name="zjm" type="text" readonly="readonly" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">手术级别：</th>
                <td class="formValue formDdlSelectorTd">
                    <select class="form-control" id="ssjb" data-enumtype="EnumSSjb">
                        <option value="">===全部===</option>
                    </select>
                </td>
            </tr>
        </table>
    </div>
</form>

<script>
    var keyValue = $.request("keyValue");
    $(function () {
        if (!!keyValue) {
            $.ajax({
                url: "/Operation/OpOperation/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json", 
                success: function (data) {
                    $("#form1").formSerialize(data);
                    getZjm();
                }
            });
        }
    });

    function AcceptClick(callBack) {
        if (!$('#form1').formValid()) {
            return false;
        }
        var postData = $("#form1").formSerialize();

        $.submitForm({
            url: "/Operation/OpOperation/SubmitForm?keyValue=" + keyValue,
            param: postData,
            success: function () {
                callBack();
                $.modalClose();
            }
        });
    }

    //获取手术名称首拼音
    function getZjm() {
        var ssmc = $("#ssmc").val();
        if (ssmc) {
            var zjm = $("#ssmc").toShouPin();
            $("#zjm").val(zjm);
        }
    }
</script>
